package friendApi

import (
	"chart.zozoo.net/app/service/friendService"
	"chart.zozoo.net/app/utils/rsp"
	"fmt"
	"github.com/gin-gonic/gin"
)

// ApplyHandle 处理好友申请
func ApplyHandle(c *gin.Context) {
	uuid := c.GetString("uuid")

	params := new(friendService.ApplyHandleParams)
	err := c.ShouldBindJSON(params)
	if err != nil {
		rsp.JsonErr(c, rsp.SetMsg(err.Error()))
		return
	}
	params.Uuid = uuid
	fmt.Println("params:", params)
	err = friendService.ApplyHandle(params)
	if err != nil {
		rsp.JsonErr(c, rsp.SetMsg(err.Error()))
		return
	}

	rsp.JsonOk(c)
}
